//
//  RichPreviewTableViewCell.swift
//  zhendeBusiness
//
//  Created by 陆文宇 on 2017/6/1.
//  Copyright © 2017年 chenliang. All rights reserved.
//

import UIKit

class RichPreviewTableViewCell: UITableViewCell {
    
    @IBOutlet weak var richLabel: UILabel!
    @IBOutlet weak var richImageView: UIImageView!
    
    var richType: RichType {
        set {
            switch newValue {
            case .none:
                richLabel.isHidden = true
                richImageView.isHidden = true
            case .txt:
                richLabel.isHidden = false
                richImageView.isHidden = true
            case .image:
                richLabel.isHidden = true
                richImageView.isHidden = false
            case .video:
                richLabel.isHidden = true
                richImageView.isHidden = true
            case .shop:
                richLabel.isHidden = true
                richImageView.isHidden = true
            case .ticket:
                richLabel.isHidden = true
                richImageView.isHidden = true
            }
        }
        
        get {
            if !richLabel.isHidden {
                return .txt
            }
            if !richImageView.isHidden {
                return .image
            }
            if !richLabel.isHidden {
                return .video
            }
            if !richLabel.isHidden {
                return .shop
            }
            if !richLabel.isHidden {
                return .ticket
            }
            return .none
        }
    }

    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}
